<template>
  <div id="ocode-web">
    <div id="head2">
      <span>溯源信息</span>
    </div>
    <div id="main2">
      <div class="heading">
        <div class="title">
          <p>快速查询</p>
        </div>
        <div id="select1">
          <div class="option" @click="iconbase">
            <i class="el-icon-office-building"></i>
            <p>基地信息</p>
          </div>
          <!-- intoStore -->
          <div class="option" @click="iconshrimp">
            <i class="el-icon-s-order"></i>
            <p>虾苗来源</p>
          </div>
          <div class="option" @click="iconfarm">
            <i class="el-icon-folder"></i>
            <p>投料信息</p>
          </div>
          <div class="option" @click="iconplant">
            <i class="el-icon-house"></i>
            <p>加工信息</p>
          </div>
          <div class="option" @click="iconsto">
            <i class="el-icon-mobile"></i>
            <p>冷库信息</p>
          </div>
          <div class="option" @click="iconDeliver">
            <i class="el-icon-truck"></i>
            <p>物流信息</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>

export default {
  name: "RootsShow",
  meta: {
    title: "溯源信息展示",
  },
  data() {
    return {
      // 是否显示工艺信息
      isShowProcess: false,
      // 是否显示基地信息
      isShowBase: true,
      // 是否显示虾苗来源
      isShowRouse: false,
      // 是否显示投料信息来源
      isShowFarm: false,
      // 是否显示农资来源信息
      isShowSupplies: false,
      // 是否显示加工厂信息
      isShowPlant: false,
      // 是否显示冷库信息
      isShowSto: false,
      // 是否显示产品信息
      isShowProduct: false,
      // 是否显示物流信息
      isShowDeliver: false,
    }
  },
  methods: {
    // 点击icon，切换界面
    iconbase() {
      this.isShowBase = true
      this.isShowRouse = false
      this.isShowFarm = false
      this.isShowPlant = false
      this.isShowSto = false
      this.isShowDeliver = false
      this.isShowProcess = false
    },
    // 点击icon，切换界面
    iconshrimp() {
      this.isShowBase = false
      this.isShowRouse = true
      this.isShowFarm = false
      this.isShowPlant = false
      this.isShowSto = false
      this.isShowDeliver = false
      this.isShowProcess = false
    },
    // 点击icon，切换界面
    iconfarm() {
      this.isShowBase = false
      this.isShowRouse = false
      this.isShowFarm = true
      this.isShowPlant = false
      this.isShowSto = false
      this.isShowDeliver = false
      this.isShowProcess = false
    },
    // 点击icon，切换界面
    iconplant() {
      if (this.plantId !== null && this.plantId !== '') {
        this.isShowBase = false
        this.isShowRouse = false
        this.isShowFarm = false
        this.isShowPlant = true
        this.isShowSto = false
        this.isShowDeliver = false
        this.isShowProcess = false
      } else this.$message.error('无加工厂信息！！')
    },
    // 点击icon，切换界面
    iconsto() {
      if (this.storageId !== null && this.storageId !== '') {
        this.isShowBase = false
        this.isShowRouse = false
        this.isShowFarm = false
        this.isShowPlant = false
        this.isShowSto = true
        this.isShowDeliver = false
        this.isShowProcess = false
      } else this.$message.error('无冷库信息！！')
    },
    // 点击icon，切换界面
    iconDeliver() {
      if (this.deliverInfo.length > 0) {
        this.isShowDeliver = true
        this.isShowBase = false
        this.isShowRouse = false
        this.isShowFarm = false
        this.isShowPlant = false
        this.isShowSto = false
        this.isShowProcess = false
      } else this.$message.error('无物流信息！')
    },

  },
}
</script>

<style >
#ocode-web {
  width: 100%;
  min-height: 100%;
  background-color: rgb(252, 244, 244);
}
#head2 {
  height: 3.6em;
  font-size: 1.5em;
  background-color: rgb(45, 130, 255);
  color: #fff;
  text-align: center;
  line-height: 3em;
}
#main2 {
  width: 100%;
  position: relative;
  top: -2em;
}
.heading {
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  margin: 0 auto;
  width: 97%;
  background-color: #fff;
  .title {
    height: 3em;
    line-height: 3em;
    &::before {
      content: '';
      position: absolute;
      left: 0.9em;
      top: 0.5em;
      width: 1em;
      height: 2em;
      border-radius: 4px;
      background-color: rgb(45, 130, 255);
    }
    p {
      font-size: 1.3em;
      color: rgb(46, 38, 38);
      margin-left: 1.8em;
    }
  }
}
#select1 {
  display: flex;
  flex-wrap: wrap;
  .option {
    // flex: 1;
    width: 33%;
    text-align: center;
    i {
      font-size: 2.5em;
      // border: 1px solid black;
      margin-top: 0.4em;
      color: rgb(119, 119, 255);
      cursor: pointer;
    }
    p {
      color: rgb(87, 84, 84);
      font-size: 1em;
    }
    i:hover {
      color: rgba(0, 0, 0, 0.3);
    }
    i:active {
      color: rgba(0, 0, 0, 0.6);
    }
  }
}
</style>
